package
{
	/*import com.engine.core.controls.events.WealthEvent;
	import com.engine.core.controls.events.WealthProgressEvent;
	import com.engine.core.controls.system.common.GlobalObjectManager;
	import com.engine.core.controls.system.wealth.SWF_Parser;
	import com.engine.core.controls.system.wealth.WealthPool;
	import com.engine.core.controls.system.wealth.WealthQueue;
	import com.engine.core.model.system.wealth.WealthGroupVo;
	import com.ming.ui.controls.Image;
	
	import config.Config;	
	import config.ParameterConst;
	
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.DisplayObject;
	import flash.display.MovieClip;
	import flash.display.Shape;
	import flash.display.Sprite;
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;
	import flash.filters.GlowFilter;
	import flash.text.TextField;
	import flash.text.TextFormat;*/
	
	import com.engine.core.controls.system.wealth.WealthQueue;
	
	import config.IListener;
	
	import flash.display.Sprite;

	/**
	 * 加载初始化数据 
	 * @author Administrator
	 * 
	 */	
	public class LoadResource extends Sprite implements IListener
	{
		public static var POPUI_URL:String;
		public static var MAIN_URL:String;
		public static var UI_URL:String = "mingUI.swf";	
		public static var VIEWUI_URL:String = "viewUI.swf";
		public static var LOGINUI_URL:String;
		public static var CREATE_ROLE_URL:String;
		public static var SELECT_ROLE_URL:String;
		public static var FRIENDUI_URL:String;
		public static var LETTER_URL:String;
		public static var SKILL_XML_PATH:String;
		public static var EQUIP_URL:String;
		public static var ITEM_URL:String;
		public static var STONE_URL:String;
		public static var SOUND_URL:String;
		public static var DEFAULT:String;

		public static var FONT_URL:String;
		public static var JADE_URL:String;
		public static var JADE_SKILL:String;
		public static var FAMILY_BUILD:String;
		public static var ALCHEMY_URL:String;
		public static var CONSCRIBE_URL:String;
		public static var DAILY_URL:String
		public static var Great_Achieve:String;
		public static var Achievement_Package:String;
		public static var SUIT:String;
        public static var ADDPROPERTYS:String;
		public static var TREASURE_URL:String;
		public static var STYLE_URL:String;
		public static var EXPEDITION_URL:String;
		public static var CARD_URL:String;
		public static var GUIDE_URL:String;
		public static var NAME_URL:String;
		public static var SAYS_URL:String;
		public static var MAP_LOADING_URL:String;

		public static var LOADING_SHOW_FONT:String;
		
		public static var MODELXML_URL:String;
		
		public static var MOUNTS_URL:String;
		public static var MOUNTS_EQUIPS_URL:String;

        public static var YBCS_URL:String;
		public static var ANIMAL_URL:String;
		public static var MOUNTS_MERGE_URL:String;
		public static var ENERGY_URL:String;
		public static var CD_URL:String;
		public static var BUFF_XML_PATH:String;
		public static var FINERY_MATIERL_URL:String;
		public static var PRINCE_URL:String;
		public static var CITY_URL:String;
		public static var NOVICE_TASK:String;
		public static var TASK_URL:String;
		public static var NPC_POS_URL:String;
		public static var MAP_NAME_URL:String;
		public static var FASHION_URL:String;
		public static var GUIDEBOOK_URL:String;
		public static var FIRST_ZIP:String;
		public static var SECOND_ZIP:String;
		public static var TARGETS_URL:String;
		public static var WEDDING_URL:String;
        public static var FESTIVAL_URL:String;
        public static var SCHOOL_URL:String;
        public static var TEAMCFG_URL:String;
        public static var EQUIPUPGRADE_URL:String;
        public static var VERSIONDESC_URL:String;
		public static var EXCHANGE_URL:String;
		public static var BAOWU_URL:String;
		public static var BAOWU_PART_URL:String;
		public static var BAOWU_INFO_URL:String;
		public static var ADVANCE_NOTICE_URL:String;
		public static var CROSS_SERSER_URL:String;
		public static var BATTLEFIELD_URL:String
		/*public var completeFunc:Function;
		
		private var _loadingBg:Image;
		private var barbg:Image;
		private var _loadingBar:Image;
		private var _progressNum:TextField;
		//private var loader:SWFLoader;
		
		private var dec:TextField;
		private var dec1:TextField;*/
		
		//private var bar:Bitmap;
		//private var ball:MovieClip;
		//private var title:TextField;
		//private var left:Number=31; //球的最左位置
		//private var long:Number; //球的最长距离
		//private var loader:SWFLoader;
		
		public static var wealthQueue:WealthQueue = new WealthQueue();
		
		public function LoadResource()
		{
			/*_loadingBg = new Image();
			_loadingBg.source = GlobalObjectManager.instance.server_host+ParameterConst.getAbsoluteURL("assets/loading/logobg.jpg");			
			addChild(_loadingBg);
			
			barbg = new Image();
			barbg.source = GlobalObjectManager.instance.server_host+ParameterConst.getAbsoluteURL("assets/loading/barbg.png");	
			barbg.x=175;
			barbg.y=458;
			addChild(barbg);
			
			//_loadingBg.visible=false
			_loadingBar = new Image();
			_loadingBar.source = GlobalObjectManager.instance.server_host+ParameterConst.getAbsoluteURL("assets/loading/bar.png");
			_loadingBar.x = 220//(1000 - _loadingBg.width)/2;
			_loadingBar.y = 473//(580 - _loadingBg.height)/2;
			addChild(_loadingBar);
			
			_progressNum = new TextField();
			_progressNum.selectable = false;
			_progressNum.x = _loadingBar.x+150;
			_progressNum.y = _loadingBar.y;
			_progressNum.width = 272;
			_progressNum.filters=[new GlowFilter(0, 1, 2, 2, 200)];
			_progressNum.defaultTextFormat = new TextFormat("Verdana",12,0xFFFFFF,null,null,null,null,null,"center");
			addChild(_progressNum);
			
			dec = new TextField();
			dec.selectable = false;
			dec.x = 270;
			dec.y = 498;
			dec.width = 500;
			dec.htmlText= '<FONT COLOR="#003299">如果你是第一次打开游戏，加载文件可能很大,请耐心等待。</FONT><A HREF="javascript:location.reload();" ><FONT COLOR="#FF0000">若加载不成功，请刷新页面</FONT></A>';
			addChild(dec);
			
			dec1 = new TextField();
			dec1.selectable = false;
			dec1.x = 170;
			dec1.y = 540;
			dec1.width = 800;
			dec1.textColor = 0xffffff;
			dec1.text = "健康游戏忠告：抵制不良游戏 拒绝盗版游戏 注意自我保护 谨防受骗上当 适度游戏益脑 沉迷游戏伤身 合理安排时间 享受健康生活";
			addChild(dec1);*/
			
			//bar=new Bitmap;
			//bg.bitmapData=Style.getUIBitmapData(LoadResource.LOGINUI_URL, "Loading_bg");
			//bar.bitmapData=getUIBitmapData(Config.LOGO, "Loading_bar");
			//ball=Style.getSprite(LoadResource.LOGINUI_URL, "Loading_ball")as MovieClip;
			//ball = new MovieClip();
			//bar.x=167;
			//bar.y=86;
			//bar.y=479;
			//ball.x=173;
			//ball.y=92;
			//ball.y=485;
			/*var format:TextFormat=new TextFormat(null, null, 0xffffff, null, null, null, null, null, "center");
			title=new TextField;
			title.defaultTextFormat=format;
			title.selectable=false;
			title.width=bar.width;
			title.textColor=0xffffff;
			title.filters=[new GlowFilter(0, 1, 2, 2, 200)];
			title.x=bar.x;
			title.y=bar.y -2;*/
			//addChild(bg);
			//addChild(bar);
			//addChild(ball);
			//addChild(title);
			//left=ball.x;
			//long=bar.x + bar.width - 12 / 2 - left;
		}
		
		/**
		 * 指定名称和URL获取位图数据
		 */		
		/*private function getUIBitmapData(url:String,name:String):BitmapData{
			if(name == null || url == null)
				return null;
			var bitmapdata:BitmapData ;
			if(bitmapdata == null){
				var clazz:Class = SWF_Parser.getInstance().getClass(url,name);
				if(clazz){
					bitmapdata = new clazz(0,0);
					//pool.addBitmapData(name,url,bitmapdata);
				}
			}
			return bitmapdata;
		}*/
		
		public function progress(per:Number, desc:String):void
		{
			//_loadingBar.scaleX = per;
			//_progressNum.text = desc;
			
		//	_loadingBar.scaleX=per;
			//ball.x=left + long * per;
		/*	if (_progressNum.text != desc)
			{
				_progressNum.text=desc;
			}*/
			
		}
		
		public function complete():void
		{
			//_loadingBar.scaleX = 1;
			//loadComplete(null);
		}
		
		/*private function loadComplete(event:WealthEvent):void
		{
			if(contains(bar))
			{
				bar.parent.removeChild(bar);
				bar.bitmapData.dispose();
				bar = null;
			}
			
			if(contains(ball))
			{
				ball.parent.removeChild(ball);
				//ball.dispose();
				ball = null;
			}
			
			if(contains(title))
			{
				title.parent.removeChild(title);
				title = null;
			}
			
			parent.removeChild(this);
			if(completeFunc != null)
				completeFunc();
		}*/
		
		/*private function loadComplete(event:WealthEvent):void
		{
			if(contains(_loadingBg))
			{
				_loadingBg.parent.removeChild(_loadingBg);
				_loadingBg.dispose();
				_loadingBg = null;
			}
			
			if(contains(barbg))
			{
				barbg.parent.removeChild(barbg);
				barbg.dispose();
				barbg = null;
			}
			
			if(contains(_loadingBar))
			{
				_loadingBar.parent.removeChild(_loadingBar);
				_loadingBar.dispose();
				_loadingBar = null;
			}*/
			
			/*if(contains(_progressNum))
			{
				_progressNum.parent.removeChild(_progressNum);
				_progressNum = null;
			}
			
			parent.removeChild(this);
			if(completeFunc != null)
				completeFunc();
		}*/
	}
}